package com.lantosec.hmrp.modules.morality.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.morality.vo.MoralityPlanLevelVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 考评方案等级 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-06-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MoralityPlanLevel extends BaseEntity<MoralityPlanLevelVO> {

    private static final long serialVersionUID = 1L;
    public MoralityPlanLevel(MoralityPlanLevelVO vo){
        this.moralityPlanLevelId = vo.getMoralityPlanLevelId();
        this.moralityPlanId = vo.getMoralityPlanId();
        this.moralityLevelId = vo.getMoralityLevelId();
        this.moralityLevelName = vo.getMoralityLevelName();
        this.minScore = vo.getMinScore();
        this.maxScore = vo.getMaxScore();
        this.peopleLimit = vo.getPeopleLimit();
        this.deptPecent = vo.getDeptPecent();
        this.branchPecent = vo.getBranchPecent();
        this.committeePecent = vo.getCommitteePecent();
    }

    @Override
    public MoralityPlanLevelVO convertToVO(){
        return new MoralityPlanLevelVO(this);
    }


    /**
     * 主键ID
     */
    @TableId(value = "morality_plan_level_id", type = IdType.AUTO)
    private Integer moralityPlanLevelId;

    /**
     * 考评方案ID
     */
    private Integer moralityPlanId;

    /**
     * 考评等级ID
     */
    private Integer moralityLevelId;

    /**
     * 考评等级名称
     */
    private String moralityLevelName;

    /**
     * 最小分值
     */
    private BigDecimal minScore;

    /**
     * 最大分值
     */
    private BigDecimal maxScore;

    /**
     * 是否限制人数(0否 1是)
     */
    private Integer peopleLimit;

    /**
     * 科室考评环节人数比上限
     */
    private Integer deptPecent;

    /**
     * 党支部考评环节人数比上限
     */
    private Integer branchPecent;

    /**
     * 考评委员会环节人数比上限
     */
    private Integer committeePecent;


    public enum ColName {
        morality_plan_level_id, morality_plan_id, morality_level_id, morality_level_name, min_score, max_score, people_limit, dept_pecent, branch_pecent, committee_pecent, 
    }
}
